package in.muton.edushare.pages.group;

import in.muton.edushare.components.autocomplete.PeoplePanel;
import in.muton.edushare.url.URLLoader;

import org.apache.wicket.PageParameters;
import org.apache.wicket.RestartResponseException;

import com.edushare.common.constants.ApplicationConstants;
import com.edushare.common.constants.URLConstants;

public class InvitePeople extends GroupBase {

	public InvitePeople(PageParameters params) {
		super(params);
		if (!getLoggedInUser().isGroupAdmin(super.groupModel.getObject())) {
			throw new RestartResponseException(URLLoader
					.getPageClass(URLConstants.UNAUTHORIZED_PATH));
		}
		add(new PeoplePanel("invite", this, super.getGroupModel()));
	}

	@Override
	protected String getActivePage() {
		return "groupInvite";
	}

	@Override
	public String getPageTitle() {
		return "Invite Poeple | "
				+ super.getGroupModel().getObject().getGroupName() + " | "
				+ ApplicationConstants.APPLICATION_NAME;
	}

}
